home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 402_01 / cforms-2.2 / example / looptest.frm < prev    next >
Encoding:
Text File  |  1993-07-20  |  1.4 KB  |  71 lines

  1. /*
  2.  * Test application for CForms.
  3.  * @(#) looptest.frm,v 1.1 1993/07/21 00:03:20 lasse Exp
  4.  */
  5.  
  6. Viewport view {
  7.     Pos 0,0;
  8.     Size 80, 23;
  9. }
  10.  
  11. Event Key DOWN  { fld_move(fld_down(NULL));  }
  12. Event Key UP    { fld_move(fld_up(NULL));    }
  13. Event Key LEFT  { fld_move(fld_left(NULL));  }
  14. Event Key RIGHT { fld_move(fld_right(NULL)); }
  15. Event Key ESC   { pic_leave(); }
  16.  
  17. Picture LoopTest Viewport View
  18. {
  19.     Literal Center, 1, "Test of loops in event routines";
  20.     Literal +0, 2,     "-------------------------------";    
  21.     Literal Center, Max, "(Press ESC to exit)";
  22.  
  23.     Field Start {
  24.     Pos 10, 8;
  25.     Type Char(1);
  26.     LValue "[";
  27.     RValue "] If you move down from here you will loop for ever";
  28.     Protected;
  29.     Event Exit {
  30.         /*
  31.          * This is a dirty thing but it will allow users to 
  32.          * interrupt this stupd test.
  33.          */
  34.         noraw();
  35.         echo();
  36.     }
  37.     }
  38.  
  39.     Field Place1 {
  40.     Pos 10, 10;
  41.     Type Char(15);
  42.     Protected;
  43.     Value "[First place]";
  44.     Event Exit {
  45.         fld_cattr(NULL, FLD_HIGHLIGHT);
  46.     }
  47.     Event Entry {
  48.         message("First place");
  49.         fld_sattr(NULL, FLD_HIGHLIGHT);
  50.         sleep(1);
  51.         fld_move(field("Place2"));
  52.     }
  53.     }
  54.  
  55.     Field Place2 {
  56.     Pos +20, +0;
  57.     Type Char(15);
  58.     Protected;
  59.     Value "[Second place]";
  60.     Event Exit {
  61.         fld_cattr(NULL, FLD_HIGHLIGHT);
  62.     }
  63.     Event Entry {
  64.         message("Second place");
  65.         fld_sattr(NULL, FLD_HIGHLIGHT);
  66.         sleep(1);
  67.         fld_move(field("Place1"));
  68.     }
  69.     }
  70. }
  71.